package com.example.duoshujuyuan.service.impl;

import com.example.duoshujuyuan.entity.UserEntity;
import com.example.duoshujuyuan.mapper.primary.DataSourceOneMapper;
import com.example.duoshujuyuan.mapper.second.DataSourceSecondMapper;
import com.example.duoshujuyuan.service.Interface.IDataSourceService;
import com.github.pagehelper.PageHelper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class DataSourceService implements IDataSourceService {

    @Resource
    private DataSourceOneMapper dataSourceOneMapper;

    @Resource
    private DataSourceSecondMapper dataSourceSecondMapper;

    @Override
    public UserEntity getUserByIdOneDataSource(Integer id)
    {
        return dataSourceOneMapper.getUserById(id);
    }

    @Override
    public UserEntity getUserByIdtwoDataSource(Integer id)
    {
        return dataSourceSecondMapper.getUserById(id);
    }

    @Override
    public List<UserEntity> getUserList(UserEntity user){
        return dataSourceOneMapper.getUserList(user);
    }
}
